1. Field of the Invention
The invention relates to an inter-process communication (IPC) mechanism in or for used with an operating system, and more particularly to an IPC that places the message routing functionality in the kernel, intelligently modifies process priority and manages context switches based on message content to minimize latency for synchronous system calls.
2. Background Information
A synchronous system call is synchronous in time and the calling context (task, process) is blocked from doing anything until the call returns. An asynchronous call, however, just posts a request and continues to perform other functions. The operating system should inform the calling context when the asynchronous call has returned (completed by the called task or process). The operating system is running under a hardware platform that may include a memory for storing software code for the operation system and a processor for executing the operating system.
Synchronous transactions through IPC mechanisms in a conventional operating system suffers from latency partly due to delays in the task scheduler performing the context switches necessary to complete the synchronous transaction. For example, DBus, which is an IPC implementation commonly used in Linux, uses a centralized daemon, which is a process running in the background, for managing a bus for message routing. All processes that wish to talk on the bus must first connect to the daemon. In a normal configuration, processes do not communicate directly with one another. FIG. 1 shows the message flow for an asynchronous DBus transaction as an example. Each time an asynchronous message associated with an asynchronous system call is sent, there must be two socket (end point or application interface call) operations and two context switches in the calling direction. One socket operation is from the client (the calling process) to the daemon and the other is from the daemon to the service (the called process) serving the asynchronous system call. For a synchronous call in DBus, the number of operations is doubled because the return direction may require the same number of operations as the calling direction. As such, the context switch time is long. Furthermore, the context switch time may depend on the priorities of the calling and called processes, as assigned by the operating system.
Accordingly, there is a need for a method that addresses the foregoing problem, and thereby reduces the context switching time. The present invention addresses these and/or other issues.